query rest api working