Add: properly serialize API errors