got the query to return a json result