improve the api