#3 Create middleware
#3 Create tests for middleware