 import Foundation
 import SwiftyJSON
 
-class API {
+class API: NSObject {
     static let shared: API! = API(host: "https://open.rocket.chat")
 
     var host: URL

        task.resume()
    }
}

            return
        }

        let configuration = URLSessionConfiguration.ephemeral
        configuration.timeoutIntervalForRequest = 30

        let session = URLSession(
            configuration: configuration,
            delegate: self,
            delegateQueue: nil
        )

        let task = session.dataTask(with: request) { (data, _, _) in
            guard let data = data else { return }
            let json = try? JSON(data: data)
            completion?(APIResult<R>(raw: json))
