Admin API requests to product-category urls result in 500

Argument 1 passed to Shopware\Core\Framework\DataAbstractionLayer\Cache\EntityCacheKeyGenerator::getEntityContextCacheKey() must be of the type string, array given, called in /app/platform/src/Core/Framework/DataAbstractionLayer/Cache/CachedEntityReader.php on line 90

This is just one example of error I got when I made a request to / api / v1 / product-category-tree. When trying to create a product-category association with / api / v1 / product-category I got

Argument 2 passed to Shopware \ Core \ Framework \ Api \ Response \ Type \ JsonFactoryBase :: createRedirectResponse () must be of the type string, array given, called in \ / app \ / platform \ / src \ / Core \ / Framework \ / Api \ / Controller \ /ApiController.php on line 745