rest: factorize resource_class

This simplifies a bit the code by using the Resource attribute where
it's needed directly in the REST controller class.

Change-Id: I10ef3912caeed405035c7ad1d7d4cc0b8ddfba7e