better/simpler implementation of resource endpoint creation, memory-wise