Added db relationships and validation