Refactoring REST wrappers to avoid code repetition.