implement task edit and insert.