Improve sorting when listing services
Use newer PHP classes
Sort categories with the largest number of entities first
Fix constant
Fix undefined property warning and logging
Use newer PHP classes