'GET /api/users/{id}/custom_builds
Returns collection of custom builds.
:param id: the encoded id of the user
:type  id: str'

@expose_api
def get_custom_builds(self, trans, id, payload={}, **kwd):

    user = self._get_user(trans, id)
    dbkeys = (json.loads(user.preferences['dbkeys']) if ('dbkeys' in user.preferences) else {})
    update = False
    for key in dbkeys:
        dbkey = dbkeys[key]
        if (('count' not in dbkey) and ('linecount' in dbkey)):
            chrom_count_dataset = trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get(dbkey['linecount'])
            if (chrom_count_dataset.state == trans.app.model.Job.states.OK):
                chrom_count = int(open(chrom_count_dataset.file_name).readline())
                dbkey['count'] = chrom_count
                update = True
    if update:
        user.preferences['dbkeys'] = json.dumps(dbkeys)
    dbkey_collection = []
    for (key, attributes) in dbkeys.items():
        attributes['id'] = key
        dbkey_collection.append(attributes)
    return dbkey_collection
