Changing the output of ElementAPI Wondering if it's possible to change the output that I'm getting from ElementAPI. I'm using the API to preload assets, and this is the output I'm getting.

{
    "data": [
        {
            "title": "Hero",
            "url": "assets/hero.jpg"
        },
        {
            "title": "Profile",
            "url": "assets/profile.jpg"
        }
    ]
}


This is great, and pretty much exactly what I need, but I'm wondering if there is a way to change the output so that, rather than using "data": I can use "manifest": which is what my preloader needs. Ideally, my code should look like this:

{
    manifest: [
        {
            "title": "Hero",
            "url": "assets/hero.jpg"
        },
        {
            "title": "Profile",
            "url": "assets/profile.jpg"
        }
    ]
}


Here also is my elementapi.php file:

namespace Craft; 

return [
    'endpoints' =&gt; [
        'assets/data/assets.json' =&gt; [
            'paginate' =&gt; false,
            'elementType' =&gt; ElementType::Asset,
            'criteria' =&gt; [
                'limit' =&gt; null,
            ],
            'transformer' =&gt; function(AssetFileModel $asset) {
                return [
                    'id' =&gt; $asset-&gt;title,
                    'url' =&gt; $asset-&gt;url,
                ];
            },
       ],
    ]
];


If there isn't a way to do this in the plugin, is there a way to get the endpoint file and change it some other way?

Thanks!
Update:

Looks like changing the 'data' key is a bit more difficult I suspected.  We just released Element API 1.3.0 that exposes the internal $resourceKey necessary to change that value.

In your elementapi.php config file, something like this should work:

UPDATE: This is the final code that I used, and it works perfectly.

return [
    'defaults' =&gt; [
        'resourceKey' =&gt; 'manifest'
    ],

    'endpoints' =&gt; [
        'assets/data/assets.json' =&gt; [
            'paginate' =&gt; false,
            'elementType' =&gt; ElementType::Asset,

            'transformer' =&gt; function(AssetFileModel $asset) {
                return [
                    'id' =&gt; $asset-&gt;title,
                    'src' =&gt; $asset-&gt;url,
                ];
            },
       ],
    ]
];




The output you're seeing is defined by your craft/config/elementapi.php config file.

You can read about that configuration file and all of the available settings in the Element API documentation at: https://github.com/craftcms/element-api/tree/v1#setup