Fixed bug in api generator