Element API User example I am attempting to build an application where Craft handles all of the API based data (JSON). I am using the Element API. I can't find an example anywhere online that outputs Users.

I am trying to output some basics first before I start outputting the custom Matrix fields etc. Here is my elementapi.json: 

&lt;?php
namespace Craft;

return [
    'endpoints' =&gt; [
        'players.json' =&gt; [
            'elementType' =&gt; 'User',
            'criteria' =&gt; ['group' =&gt; 'player'],
            'transformer' =&gt; function(EntryModel $entry){
                return [
                    'username' =&gt; $entry-&gt;$username,
                    'jsonUrl' =&gt; UrlHelper::getUrl("player/{$entry-&gt;id}.json")
                ];
            },
        ]
    ]
];


Any help or an example with some custom matrix user fields would be much appreciated! Thanks a bunch!
If you set the elementType to User, then the transformer will have a UserModel object passed in like so:

&lt;?php
namespace Craft;

return [
    'endpoints' =&gt; [
        'players.json' =&gt; [
            'elementType' =&gt; 'User',
            'criteria' =&gt; ['group' =&gt; 'player'],
            'transformer' =&gt; function(\Craft\UserModel $user) {
                return [
                    'username' =&gt; $user-&gt;username,
                    'jsonUrl' =&gt; UrlHelper::getUrl("player/{$user-&gt;id}.json")
                ];
            },
        ]
    ]
];