Added a method to send a message and get the id.