Fix code formatting
Convert to use websocket connection