func test running separately of unittests; adding middleware to store request object in database