refactoring code. adding base api controller