Apologies for the long delay in responding. The challenge with loading packages in the cloud is that the parser has to read the function name before the package is loaded. To make this work, you have to provide the context for the function.
Here is a simple example. First my package, saved as "myCloudPackage.m":
BeginPackage["myCloudPackage`"]
Unprotect[myFunc];
myFunc::usage="simple cloud function";
Begin["`Private`"]
myFunc[x_] := 1+x
End[]
Protect[myFunc];
EndPackage[]
I then upload the file to the cloud:
CopyFile["myCloudPackage.m", CloudObject["myCloudPackage.m"]]
Now I can deploy an APIFunction to use the package. Note that I'm using the full context of myFunc.
api = CloudDeploy[
APIFunction[{"x" -> "Number"},
CloudGet[CloudObject["myCloudPackage.m"]];
myCloudPackage`myFunc[#x] &]]
Finally evaluate in Mathematica:
In[227]:= URLExecute[api, {"x" -> 3}]
Out[227]= "4"