refactoring
api controller