Improved the api