Schema query as a json object and fixed bug on json query results