websocket api for html pages to interact