'convert dicts, lists to json'

def preprocess(self, params):

    for (key, value) in iteritems(params):
        if isinstance(value, (dict, list)):
            params[key] = json.dumps(value)
    return params
