refactor to use new rest interface