added event emitters and server
added event emitters and server