ASP.NET Core + React - SPA is shown when trying to reach api

I'm developing an ASP.NET Core application with React+Redux, using Visual Studio 2019 default project template. The SPA should run when the user navigates to "/" but it shows up whatever I type in the url, including api endpoints with GET verb.

I've added some configuration in the startup, but it's basically the same, and I haven't moved anything around:

if (env.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
}
else
{
    app.UseExceptionHandler("/Error");
    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
    app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseSpaStaticFiles();
app.UseWebSockets();

app.UseRouting();
app.UseEndpoints(endpoints =>
{
    endpoints.MapControllerRoute(
        name: "default",
        pattern: "{controller}/{action=Index}/{id?}");
});

app.UseSpa(spa =>
{
    spa.Options.SourcePath = "ClientApp";

    if (env.IsDevelopment())
    {
        spa.UseReactDevelopmentServer(npmScript: "start");
    }
});

I have an API inside a controller LinkToUtilsController (which is decorated with the attribute [Route("api/[controller]/")]) whose purpose is to get a link id and redirects to an external resource (or returns an HTTP error). The endpoint is http://localhost/api/linktoutils/redirect?linkId=STEP, but when I open it from the browser, it shows the ReactJS application (which don't even use routing and will never need it). Strange thing is that it works if then I force reload the page with CTRL+F5.

This happens either from localhost or production.