List items belonging to an API call. Used for list_services() and
    list_incidents()

def list_items(action, key, profile_dict=None, api_key=None, opts=None):
    '''
    List items belonging to an API call. Used for list_services() and
    list_incidents()
    '''
    items = salt.utils.json.loads(query(
        profile_dict=profile_dict,
        api_key=api_key,
        action=action,
        opts=opts
    ))
    ret = {}
    for item in items[action]:
        ret[item[key]] = item
    return ret