simplified resource api inspired by @gabac