add test_query; fix json parsing