Integrated socket.io, added events listening