Added API calling in the controller