implemented tojson query command