fix api url generation