edit rest api ajax