add header options validations, add support for an alternate primary key