Install a "package" on the REST server

def package_install(name, **kwargs):
    '''
    Install a "package" on the REST server
    '''
    DETAILS = _load_state()
    if kwargs.get('version', False):
        version = kwargs['version']
    else:
        version = '1.0'
    DETAILS['packages'][name] = version
    _save_state(DETAILS)
    return {name: version}