Transition registration decode to middleware.
Log on requests, and log error codes.
Be more careful about handling errors here.