update api and template.
reference to client api.