Fix many Bugs with APIs