moved sendMessage to routes