def sort_lists(ret_template):
    """ Used to sort the nested list returned by the template dict. """
    for db in ret_template.keys():
        for key in ret_template[db].keys():
            if isinstance(ret_template[db][key], list):
                ret_template[db][key].sort()
    return ret_template