call api from controller.

call api from controller, changes in login.