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
Merge pull request #1318 from reciprocity/feature/fix-for-id-of-0

Fixes for when <resource>.id == 0