incorporate query count in the response