Added validations for each message type to ensure it follows the spec.

Motivation: Addressed code review comments and added new
validations/checks for each message type.
Please take a look again.