fixing some bugs in the apis