send-message encapsulates json encoding
encapsulate reading of json messages