Converting some messages to JSON format.