fixed bug in api