Communicating with JSON over socket. Splitting websocket code into seperate controller.