Switching tasks endpoint to return JSON