moved common methods to BaseResource. More to come.