Refactor resources controllers & fix test suite