} manager.request(baseURL + path, method: method, parameters: parameters, encoding: encoding) .validate() .responseJSON { response in switch response.result { case .failure(let error): self.readFromCache(handler) case .success: self.writeResponseToCache(response: response) } }