handle api key errors better