adding provisioner id to task apis. Taking or finishing a task

with a provisioner that does not exist will not be allowed.
Also refactoring to clean up code around the request by making
the requests actual objects instead of working directly with json.
The code here is duplicated between different functions, since the only change is the Class name for de-serialization.