Do I understand correctly that api host will be http://127.0.0.1:8082 here forever?
I think that no. So you need get such value dynamically.