def build_response(df, match_type, similarity_metrics, match_count=3):
    """Populates the records to be returned in response."""
    # Dictionary to build response packet
    resp_dict = {}

    # Building the response
    resp_dict['match_type'] = match_type
    resp_dict['similarity_metrics'] = similarity_metrics

    match = []
    for i in range(min(df.shape[0], match_count)):
        row = df.iloc[i, :]

        record = {}
        record['id'] = row['id']
        record['name'] = row['name']
        record['description'] = row['description']
        record['URL'] = row['URL']
        match.append(record)

    resp_dict['match'] = match
    # return json.dumps(resp_dict)
    return resp_dict