Added relations and validations to models