make the api url dynamic