Json based query engine