hook before => sub { set serializer => ( request->params->{format} eq 'xml' ? 'XML' : 'JSON'); };