def exps_by_states_dict(api, states):
    """ Return current experiment in `states` as a per state dict """
    exps = api.get_experiments(state=','.join(states))['items']
    exp_states_d = {}
    for exp in exps:
        exp_states_d.setdefault(str(exp['state']), []).append(exp['id'])
    return exp_states_d
