I am not sure how to implement this via registerRestInterface.

I've tried:

Json rest_api(string param0, string param1) {
    Json j;
    j.id = "1";
    return j;
}

which causes an exception with message:

...Got JSON of type undefined, expected object....

So, is there a formal way to return a JSON through POST?

Thanks.