made api work as a nested set of routes