Add a switch to return JSON for failed tasks and add a new route to manager