Remove duplicate sending message and uniformize error response