fixed bug on api