exception handling for rest services