Don't dispatch task if there is no data

I've pulled out the triggering of tasks to a separate function, this
then handles avoiding dispatch if there is no data.

I have also removed dispatching of tasks from PUT as this is only used
for cleaning out a data set and the transformed data set should be
emptied separately.