I am using it on the Wolfram Programming Cloud. Its interesting that it works on your local copy of Mathematica.
I also tried copying the code into a fresh notebook and the same issue occurred. Just in case, I also tried retyping it explicitly instead of copying it and that didn't help either.
The two pieces common to the problem seem to be the APIFunction and using it in the Wolfram Programming Cloud.
Thanks for looking into it. If you have any more suggestions I am open to them!
I also tried this simpler code with the APIFunction and had the same issues:
INPUT:
addf[x_,y_]:=
x+y;
test = APIFunction[{"g" -> "Integer", "Hf"->"ZIPCode"}, addf[#g,#Hf] &];
test[<|"g"->5, "Hf"->"ZIP 47025"|>]
OUTPUT:
<|g->5 g+5 Hf,Hf->6 g+6 Hf|>
Again, if I combine the "addf" function, APIFunction, and the inputs on the same line, the output works fine.