added a count to the query_structure JSON output