Added most of the code to manage tasks (except task create/update).