added extensions to resource resolver, refactoring ERROR() calls