refactored domain model and REST resources