Fixed bugs in the controller APIs and added log messages