Remove use of deprecated datamodel classes in \api