SAM REST service refactoring