Implement socket.io api