public_data method
handle api request errors