callback with TypeError in getById() when id is null or undefined