Implemented socket.io on the server side