[dry] refactor respond_to json
change request with test