refactored the server to use the socket.io rooms