added serialize methods to db objects