Refactored resource classes to inherit from a base REST class

Makes it easier to create new resources in the future.

@joergpatz Please check implementation and tell me what you think.