[api] speed up package indexing for non-products

solves also a crash in delayed job when package got removed again