Added a method that performs the query and returns the JSON string