API tweaks

Initial work on API and looking at indexes for query patterns.
looks like they are for functional controller specs and not request specs