Abstracted socket.io logic into controller