fixing bug in api