fix the query creation to hit Andrew's API correctly