Complete work on messaging subset of API

This commit also implements the Events API too, a prerequisite for
acceptance testing the messaging APIs.