Use Scotty's error system, augmented to set status well.
Use a uniform layout for resource definitions.
Factor out the pattern of 1. parse 2. do sth in database 3. respond