This line is confusing me...

    args.shift.tap {|r| r && api.role(r)}