Phase 2a: query API