refactored message and user model to the new messages API