sendmessage API and UI