Refactored Rest module