added message endpoint functionality