Update methods getReceivedMessagesBySubject and getSentMessagesBySubject to return map with metadata