Include more things in the JSON result (the query, etc.)
Missing comma
Fix comma adding logic