import json


def message_to_json(message):
    """
    This function tranforms the string message to a json
    string, this is to make all REST responses
    to be in JSON format and easier to implement
    in a consistent way.
    """
    
    #if message is alreay in json then do not do anything
    mesage_dict = {}
    
    try:
        message_dict = json.loads(message)
    except ValueError:
        message_dict = {
            "msg": message
        }
        
    return json.dumps(message_dict)