Serialization of nested-resource(s)

If a resource contains one or a list of resources they will be serialized to. This gives greater control of the JSON data representation. Also made resourceName optional as a nested resource would otherwise mess up the structure.