converted WebSocket requests to AJAX