Reorganise app into models and api modules.