Cleaner implementation of json response intercept.