Refactored RestController and made it less complex, no more need for separate Trait.