Refactoring to use new REST interface