create restful query factory