Serializes embeds and fields in the correct format