Task API Error handling