 }
                    }
                } else {
                    add_alert(`Error: ${xhr.status}, ${xhr.responseText}`, "danger")
                }
            };
            xhr.send();
        }

        // function to send requests (helper function for other functions that do similar server requests)
        function send_request(method, endpoint, body, spinner, notifications = true) {
            const xhr = new XMLHttpRequest();
            xhr.open(method, endpoint);
            xhr.setRequestHea