remove unused code and refactor api controllers
fix params issue