refactor models. Add CSDoc. Add 404 handling