fix id mapping and implement filters

Now the lists are filtered before being sent to UI and Storage.
More checks have been added for the mapping of IDs.