Introduce AbstractController and CollectionResource to get rid of some of the duplication.