More API's and bug fixes