Added lots of call to server and handling of events