         case .failure(let err):
             completion(.failure(err))
         case .success(let json):
-            guard let json = json as? JSON else { completion(.failure(.decode)); return }
-            guard let resp = T(json: json) else { completion(.failure(.decode)); return }
+            guard let json = json as? JSON, let resp = T(json: json) else { completion(.failure(.decode)); return }
             completion(.success(resp))
         }
     }

    var request = URLRequest(url: url)
    request.httpMethod = "POST"
    request.httpBody = try? JSONSerialization.data(withJSONObject: data)
    dataTask(request: request, completion: completion)
}


        }

        let rawJson = try? JSONSerialization.jsonObject(with: data)
        guard let json = rawJson else { completion(.failure(.decode)); return }

        completion(.success(value: json))
