Sending json representation of message to endpoint