moved save task logic to service layer