Fixes for when <resource>.id == 0

* On client side, these objects would not be cached, and stubs would not
  work properly
* On server side, the objects would have invalid `href`, `selfLink`, and
  `viewLink` values and missing `Location` headers