uri now defines entire resource, broke out some of the functions for reuse