added json output of query results