With Element API, can I combine two entry types into a JSON object, keyed by type?
I'm using Craft as a headless CMS, so I wanted full control over the JSON it was returning. I didn't figure out how to do this with Element API, but it's very simple to write your own plugin that turns entries into JSON. Craft already includes the code to look up entries, so it's easy.

A basic controller might look something like:
    

class MyCustomPlugin_SomeResourceController {

    public function actionWidgets() {
        $criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Entry);
        $widgetEntries = $criteria-&gt;section("resources")-&gt;type("widget")-&gt;find();

        // map entries to PHP objects
        $widgetObjects = array_map(function($entry) {
            return [
                "name" =&gt; $entry-&gt;title
            ];
        }, $widgetEntries);

        $this-&gt;returnJson([
            "widgets" =&gt; $widgetObjects,
            "anotherThing" =&gt; "somethingElse"
        ]);
    }

}


In the actual app, I'm combining several different types of entries into one endpoint, so I extracted the reading and formatting into services, which I combine in various controller actions. 

Presumably, Element API has some other features that I'm missing out on, but I haven't noticed.