implemented sending message to backend