def clean(input_dict):
    """
    Alter data to match data model 
    
    This function reformats isbns, and modifies the id name
    from a dictionary returned from retreive_details. It also 
    changes the id key to googleId to match the format that the
    API endpoint specifies.
    
    Input:
    input_dict  - a dictionary output from retreive_details using
                  the list of keys required for the BetterReadsDS 
                  API response.
    
    Output:
    output_dict - a dictionary ready to send as a response to a
                  request received by the server.
    """
    
    my_dict = {}
    
    # Change the format of the isbn data
    try:
        for i in input_dict['industryIdentifiers']:
            my_dict[("".join(i['type'].split('_')).lower())] = i['identifier']

        # Add isbns to dictionary and remove the industryIdentifiers key
        input_dict.update(my_dict)
        del input_dict['industryIdentifiers']
    except KeyError:
        pass
    
    # Change id to googleId
    # Try/except should not be necessary here.
    # Google Books always returns an id
    input_dict['googleId']=input_dict['id']
    del input_dict['id']
    
    output_dict = input_dict
    return output_dict