working angularjs on_ type dispatcher, almost working server dispatcher code