anchor.diff:  
   Of course, sometimes things don't go to plan. Perhaps the browser timed out, or the service has timed out, or the service encounters an error. We've all gotten the annoying 404 ("Page not found") error when attempting to visit a page that doesn't exist or couldn't be routed to correctly. That 404 is a *status code*. It conveys information about the state of the operation. There are http://en.wikipedia.org/wiki/List_of_HTTP_status_codes[*many* status codes] divided along ranges for different purposes. When you make a request to a webpage in the browser, it is an HTTP `GET` call, and - if the page shows up - it will have returned a 200 status code. 200 means `OK`; you may not know it, but it's there. 
   
  -* Status codes in the **100x range** (from 100-199) are *informational*, and describe the processing fo the request.  
  +* Status codes in the **100x range** (from 100-199) are *informational*, and describe the processing for the request.  
   * Status codes in the **200x range** (from 200-299) indicate  the action requested by the client was received, understood, accepted and processed successfully
   * Status codes in the **300x range** (from 300-399) indicate  that the client must take additional action to complete the request, such as following a *redirect*
  -* Status codes in the **400x range** (from 400-499)   is intended for cases in which the client seems to have errored and must correct the request before continuing. The aforementioned 404 is an example of this.
  +* Status codes in the **400x range** (from 400-499)   is intended for cases in which the client seems to have erred and must correct the request before continuing. The aforementioned 404 is an example of this.
   * Status codes in the **500x range** (from 500-599)  is intended for cases where the server failed to fulfill an apparently valid request.
   
   ## Building a REST service 
  
positive.code: ### Using HTTP to signal Errors 
   
  
  All the methods in the REST service call `validateUser` which in turn verifies that the user in question exists and - if it doesn't - throws a `UserNotFoundException`. The definition of this exception is shown. It's annotated with a Spring MVC `@ResponseStatus(HttpStatus.NOT_FOUND)` which tells Spring MVC to send back an HTTP status code (404) whenever this exception is triggered. This is a _really_ nice arrangement: you can think in terms of your business domain in your code _and_ you get smart handling that maps nicely to how HTTP signals erros to the client, using status codes. Spring MVC provides a _lot_ of different places to cleanly http://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc[layer in generic, application-global and controller-local error handling logic]. 
  
  
  ###  Testing a REST Service
  
negative.code: //spend a min to talk about HAL + ALPS
  
  The `BookmarkResource` type *wraps* a `Bookmark` and provides a nice, centralized place to keep link-building logic.  
  At a minimum, a resource should provide a link to itself (usually a link whose `rel` value is `self`). We could simply write out http://127.0.0.1:8080/{userId}/bookmarks/{id}[`http://127.0.0.1:8080/\{userId\}/bookmarks/\{id\}`] (substituting the path variables for appropriate values), but this will fail as soon as we move to a different host, port, and context root. We could use the `ServletUriComponentsBuilder` to simplify some of this work. But why should we? After all, Spring MVC  _already knows_ about this URI. It's *in* the `@RequestMapping` information on every controller method! Spring HATEOAS provides the convenient static `ControllerLinkBuilder.linkTo` and `ControllerLinkBuilder.methodOn` methods to extract the URI from the controller metadata itself - a marked improvement and in keeping with the DRY (do not repeat yourself) principle.  The example shows how to build a `Link` object directly, specifying an arbitrary value for `href` (in this case, the URI for the bookmark itself), how to build a link based on the `@RequestMapping` metadata on a Spring MVC controller, and how to build a link based on the `@RequestMapping` metadata on a specific Spring MVC controller method.
  
  With this in place, the only remaining changes substitute  `Bookmark` types for `BookmarkResource` types. 
  
  