Factoring out the get_pair_operation_json method.