def drop_id_prefixes(item):
    """Rename keys ending in 'id', to just be 'id' for nested dicts.
    """
    if isinstance(item, list):
        return [drop_id_prefixes(i) for i in item]
    if isinstance(item, dict):
        return {
            'id' if k.endswith('id') else k: drop_id_prefixes(v)
            for k, v in item.items()
        }
    return item