echoing back messages from client in json format