messages model and test case implemented