rest API
code refactoring