Refactoring of REST interface