more api work for codegen