Minor fixes on apicontroller.