created serializeWithRelationships method
added some basic tests