Bugfixes in ApiController