Added the EventEmitter functionality to the Api