Converted from long polling to websockets