better support for sending JSON messages
small API change