Resource generation improvements

Resource generation still needs lots of work, in order to return the
same resources in the same locations for all requests.