Fist impl of notification serivce

And a number of bugs fixed