trim the api