                })
                .then(response => response.json())
                .then(data => alert(data.message))
                .catch(error => alert('Error: ' + error));
            }
        }

        function stopServer() {
            if (confirm('Are you sure you want to stop the server?')) {
                fetch('/api/server/stop', { 
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    }
          