add error message in rest call & add error catch in rest api