changed back to rest api as I don't have a clear understanding of socket.io