Rolled back server changes, modified for better websocket handling