Refactoring CYPHER_REST_API to query