Switch from long-polling to WebSocket API