Refactored REST processor