def list_refs(profile, ref_type=None):
    resource = "/refs"
    if ref_type:
        resource += "/" + ref_type
    data = api.get_request(profile, resource)
    result = [prepare(x) for x in data]
    return result