modifications to validation code, and validation initialization code to implement validation on API