Improvements to the api