changed $success to $hasError with a default, adjusted logic where needed
added onTaskData() callback