modifying casework to use lrutils error handler and after_request headers