How to set dynamic criteria for endpoint with the Element API plugin?
Finally figured this out.
By using the variable slug in the endpoint URL I was able to listen for the category in the currently viewed category slug and pull the data i needed for my google map. The trick is to typomake the end point a function - i was trying to set the criteria outside of the endpoint which is, in retrospect, silly.

'locations/&lt;slug:{slug}&gt;.json' =&gt; function($slug) {

                        $criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Category);
                        $criteria-&gt;slug = $slug;
                        $category = $criteria-&gt;first();
                        return [
                            'elementType' =&gt; 'Entry',
                            'criteria' =&gt; [
                                'section' =&gt; 'directory',
                                'relatedTo' =&gt; ['targetElement' =&gt; $category],
                                'limit' =&gt; null,
                            ],
                            'transformer' =&gt; function(EntryModel $entry) {
                                return [
                                    'title' =&gt; $entry-&gt;title,
                                    'mapinfo' =&gt; $entry-&gt;mapaddress,
                                    'url' =&gt; $entry-&gt;slug
                                ];
                            },
                        ];
                    },