Validations

This is the code for the database work and then added the validations to that because I needed the code from the database work.