#2 Create middleware
#2 Create tests for middleware