fixes the n+1 queries on content and media type controllers and ensures if there are no ids that the query doesn' texeucte.