login, add, testapi methods in controller
fix compiling errors