API generator improvement