'If a string is passed in, just return it
or else if a dict is passed in, encode it
as a json string.'

def encode_data(self, data):

    if (type(data) is str):
        return data
    elif (type(data) is dict):
        return json.dumps(data)
    else:
        return ''
