Added tests and code for emmiting events when endpoints starts up