Refactored REST resources, tidy up code, create additional model structures.