Fix query data api

this should resolve https://groups.google.com/forum/#!search/API$20Having$20trouble$20filtering$20form$20data/formhub-users/Z9I6HVk3IJc/OgTTYaVVe5IJ