T-Systems interview question

write one rest API with exceptional handling