convert message type from plain text to json object