Handling API responses and errors - DATANALYTICS