fix subscription server  bug introduced when porting to async, add support for event in server, reorganization

lots of changes. I should have tested more but there are so many changes it is better to merge otherwise it will be hard to merge
This value will have random value. This is interesting, but it is better to initialize with zero. :)