Convert message objects to text before api serialization

Change-Id: Ic5705510e7586feb93ee98e1f2f02e05355a1b15