query_api sample (fixes #85)