fix the api error, and replace newline to <br />