Handle API 500 error