Data manipulations moved from controller to service, added service for socket.io