fix the api endpoint