Make API Error return a hash