Why dont you look at using something like 'NANCY' for your 'server side' application, and define a REST interface - then you could define a route
Get["/actions/{command}"]
you can then run the 'command' and return the result (possibly marked up) in the REST result/payload