change REST API url to api/query?query=
add test for select