fixed minor bugs in api controllers