using generic class based views to simplify the REST view logic