Updates the api with some basic changes.

api changes and bug fixes