added rest exception handling