Handle json response in a centralized manner