Added some error handling.
Completed message page, except AJAX.