make list_messages() and send_message() return JSON-like structures