Added associations and some validation to the models