function serves as friction free interface between socket.io and angular by wrapping events in