Refactored the generic resource. Wrote docstrings