refactoring: restructuring of api and repos