api error handling chain and special exceptions