Improve API generator to also support enums