Add unit tests for GetMessagesById
Fix broken tests