added final newline to all the error files
cleaned up and documented the request middleware