hooked up query endpoint