reformat api exceptions