refactor the files where all the basemodels are defined split at least into API models and internal models