Ajax: update and create task