Actions not fired after call to remote API


I have a Virtualmin domain structure I use for all Virtual Servers.
I create a top level server with only mySQL enabled.
Then I create a Sub Server with the FQDN and web and awstats enabled.

I have looked for a way to automate this process and could not get the Server Template to do it for me. I can’t even disable features.
Then I looked at the Action command and have successfully created a CREATE_DOMAIN action that does what I want when I create a new top level domain in the Virtualmin GUI.

Now to my problem:
If I use the remote API to create a Top level server, the action script doesn’t seem to fire off and the Sub server is not created.
Is this by design or have I done something wrong ?