Added code to allow retrieval of JSON objects from query results.