making api url dynamic