Add frontend logic for messages.