Use a mapping table to get numeric ids and to track which entity belongs to which endpoint.