autogenerate api - reorganize structure