Adding basic validating, and creating the database model