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.

This also brings the transform triggering endpoint into line with using
trigger_transforms. This was passing through strings before but it is
now expected to be passing through datetime instances.