Change compose api call to /api/compose. Change messages.readMessage to messages.read and same with unread