fixed bugs in Api methods