Added getRelation functions to Database