fixed bug in ApiController