Adding middleware and mocked models.