working on http and websocket server communication and error handling