Modified RestControllerTrait to allow its usages to stay ignorant of Symfony's HttpFoundation.