Code written to solve error response coming from server