Support for HTTP template, Big refactoring for Repository and Resources