adds comments and tests to error middleware
deletes old decorator