 
     //Mark: EventListeners
 
-    open func onOpen(_ onOpenCallback: @escaping (Void) -> Void) {
+    open func onOpen(_ onOpenCallback: @escaping ((Void) -> Void)) {
         self.onOpenCallback = onOpenCallback
     }
 
-    open func onError(_ onErrorCallback: @escaping (NSError?) -> Void) {
+    open func onError(_ onErrorCallback: @escaping ((NSError?) -> Void)) {
         self.onErrorCallback = onErrorCallback
 
         if let errorBeforeSet = self.errorBeforeSetErrorCallBack {
             self.onErrorCallback!(errorBeforeSet)
-            self.errorBeforeSetErrorCallBack = nil;
-        }
-    }
-
-    open func onMessage(_ onMessageCallback: @escaping (_ id: String?, _ event: String?, _ data: String?) -> Void) {
+            self.errorBeforeSetErrorCallBack = nil
+        }
+    }
+
+    open func onMessage(_ onMessageCallback: @escaping ((_ id: String?, _ event: String?, _ data: String?) -> Void)) {
         self.onMessageCallback = onMessageCallback
     }
 
-    open func addEventListener(_ event: String, handler: @escaping (_ id: String?, _ event: String?, _ data: String?) -> Void) {
+    open func addEventListener(_ event: String, handler: @escaping ((_ id: String?, _ event: String?, _ data: String?) -> Void)) {
         self.eventListeners[event] = handler
+    }
+
+    open func removeEventListener(_ event: String) -> Void {
+        self.eventListeners.removeValue(forKey: event)
+    }
+
+    open func events() -> Array<String> {
+        return Array(self.eventListeners.keys)
     }
 
     //MARK: URLSessionDataDelegate

        DispatchQueue.main.async {
            if let errorCallback = self.onErrorCallback {
                errorCallback(error as NSError?)
            }else {
                self.errorBeforeSetErrorCallBack = error as NSError?
            }
        }
    }


        self.readyState = EventSourceState.connecting
        self.urlSession = newSession(configuration)
        self.task = urlSession!.dataTask(with: self.url)

        self.resumeSession()
    }

    internal func resumeSession() {
        self.task!.resume()
    }

    internal func newSession(_ configuration: URLSessionConfiguration) -> Foundation.URLSession {
        return Foundation.URLSession(configuration: configuration,
                                     delegate: self,
                                     delegateQueue: operationQueue)
    }

    //Mark: Close
