apiGenerator: fix call convention problems