\Drupal calls should be avoided in classes, use dependency injection instead in modules/paragraphs_library/src/Controller/LibraryItemController.php file