Restructured messaging API