def serialize_biomass_v2(analysis, type):
    """Convert the output of the biomass_loss analysis to json"""
    return {
        'id': None,
        'type': type,
        'attributes': {
            'biomassLoss': analysis.get('biomassLoss', None),
            'biomassLossByYear': analysis.get('biomassLossByYear', None),
            'cLossByYear': analysis.get('cLossByYear', None),
            'co2LossByYear': analysis.get('co2LossByYear', None),
            'areaHa': analysis.get('area_ha', None)
        }
    }