custom json exception handling