added the option to intercept requests and responses