API Code refactor, created sub directory and new files grouped into their api-groups, e.g. inv,map,dgm