Refactoring REST calls for datasets