Added ability to save query results as JSON file