Reorganized the task api a bit and created a re-usable task api client.
Tested and fixed up the task api client.