server changes, added websocket handling