Minor bug fixed in api_controller