Added ability to send json messages.