building message model and controller