fix add/delete message actions + move base functions to service
Merge remote-tracking branch 'master/master'