Fix dynamic api url bug