JSONification of messages