Unify query API

- Put API under single query endpoint #77
- Add detect_time filtering #77
- Add unit tests that exercise API