changes and improved to the api