improving enforce_json_post_put_patch_requests