Updated APIPinningMiddleware to use the cache backend