removed some bugs from the API wrapper