Add the upstream wherever you want in the file, and add the location /API directly under the Location: / section that looks similar.