Updated the message controller to do some validation and send errors if there's problems