anchor.diff:        
         server.listen((HttpRequest request) {
           print("${request.method}: ${request.uri.path}");
  -        addCorsHeaders(request.response);
  -
  +        _addCorsHeaders(request.response);
  +        EndpointHandler handler = _getEndpointHandler(request);
           switch (request.method) {
  -          case "GET": 
  +          case "GET":
               _handleGet(request);
               break;
             case "POST": 
  
positive.code: void main() {
    RestServer server = new RestServer(HOST, PORT);
    
    server.registerEndpoint(new RouteHandler());
    server.registerEndpoint(new UserHandler());
    
    server.listen();
  }
  
negative.code: import 'dart:async' show Future;
  import 'dart:convert' show UTF8;
  
  
  class RelativeEndpoint{
    final String id;
    final String current;
    final Iterable<String> nextPath;
    final RelativeEndpoint parent;
    
    RelativeEndpoint(this.id, this.nextPath, this.parent, this.current);
    
    bool get hasNextEndpoint => nextPath != null && nextPath.isNotEmpty;
    bool get hasParent => parent != null;
    
    String get nextEndpoint {
      if (hasNextEndpoint){
        return nextPath.first;
      }else{
        return null;
      }
    }
  
    @override
    String toString(){
      return "$current/$id";
    }
  }
  
  abstract class EndpointHandler {
    
    final String endpoint;
    final Map<String, EndpointHandler> endpointHandlers = new Map<String, EndpointHandler>();
    
    EndpointHandler(this.endpoint);
    
    void register(EndpointHandler handler){
      endpointHandlers[handler.endpoint]= handler; 
    }
  
    RelativeEndpoint createRelativeEndpoint(RelativeEndpoint parentRelativeEndpoint){
      List<String> pathElements = parentRelativeEndpoint.nextPath;
      if (pathElements==null || pathElements.isEmpty){
        throw new ArgumentError("Current endpoint ($endpoint) path cannot be null");
      } else {
        if (pathElements.first == endpoint){
          if (pathElements.length > 1){
            String id = pathElements.elementAt(1);
            return new RelativeEndpoint(id, pathElements.getRange(2,pathElements.length), parentRelativeEndpoint, endpoint);
          }else{
            return new RelativeEndpoint(null,null, parentRelativeEndpoint, endpoint);
          }
        }else{
          throw new ArgumentError("Unexpected entity (${pathElements.first}), expected ($endpoint)");
        }
      }
    }
    
    String handlePut(String received,RelativeEndpoint parentRelativeEndpoint){
      RelativeEndpoint relEp = createRelativeEndpoint(parentRelativeEndpoint);
      if (relEp.hasNextEndpoint && endpointHandlers.containsKey(relEp.nextEndpoint)){
        return endpointHandlers[relEp.nextEndpoint].handlePut(received, relEp);
      } else {
        return _handlePut(received, relEp);
      }
    }
    
    String handlePost(String received,RelativeEndpoint parentRelativeEndpoint){
      RelativeEndpoint relEp = createRelativeEndpoint(parentRelativeEndpoint);
      if (relEp.hasNextEndpoint && endpointHandlers.containsKey(relEp.nextEndpoint)){
        return endpointHandlers[relEp.nextEndpoint].handlePost(received, relEp);
      } else {
        return _handlePost(received, relEp);
      }
    }
    
    String handleGet(RelativeEndpoint parentRelativeEndpoint){
      RelativeEndpoint relEp = createRelativeEndpoint(parentRelativeEndpoint);
      if (relEp.hasNextEndpoint && endpointHandlers.containsKey(relEp.nextEndpoint)){
        return endpointHandlers[relEp.nextEndpoint].handleGet(relEp);
      } else {
        return _handleGet(relEp);
      }
    }
    
    String handleDelete(RelativeEndpoint parentRelativeEndpoint){
      RelativeEndpoint relEp = createRelativeEndpoint(parentRelativeEndpoint);
      if (relEp.hasNextEndpoint && endpointHandlers.containsKey(relEp.nextEndpoint)){
        return endpointHandlers[relEp.nextEndpoint].handleDelete(relEp);
      } else {
        return _handleDelete(relEp);
      }
    }
    
    String _handlePut(String received, RelativeEndpoint relEp);
    String _handlePost(String received, RelativeEndpoint relEp);
    String _handleGet(RelativeEndpoint relEp);
    String _handleDelete(RelativeEndpoint relEp);
  }
  
  class RouteHandler extends  EndpointHandler{
    
    RouteHandler(): super("routes");
    
    @override 
    String _handlePost(String received, RelativeEndpoint relEp){
      if (relEp.id == null){
        throw new ArgumentError.notNull("$relEp");
      }
      return "$relEp <- $received";  
    }
    
    @override 
    String _handlePut(String received, RelativeEndpoint relEp){
      if (relEp.id == null){
        throw new ArgumentError.notNull("$relEp");
      }
      return "$relEp <- $received";  
    }
    
    @override 
    String _handleGet(RelativeEndpoint relEp){
      if (relEp.id == null){
        return "list";
      }else{
        return "getting ${relEp}";
      }
    }
    
    @override 
    String _handleDelete(RelativeEndpoint relEp){
      if (relEp.id == null){
        throw new ArgumentError.notNull("$relEp");
      }
      return "deleting $relEp";
    }
  }
  
  class UserHandler extends  EndpointHandler{
    
    UserHandler(): super("users");
    
    @override 
     String _handlePost(String received, RelativeEndpoint relEp){
       if (relEp.id == null){
         throw new ArgumentError.notNull("$relEp");
       }
       return "$relEp <- $received";  
     }
     
     @override 
     String _handlePut(String received, RelativeEndpoint relEp){
       if (relEp.id == null){
         throw new ArgumentError.notNull("$relEp");
       }
       return "$relEp <- $received";  
     }
     
     @override 
     String _handleGet(RelativeEndpoint relEp){
       if (relEp.id == null){
         return "list";
       }else{
         return "getting ${relEp}";
       }
     }
     
     @override 
     String _handleDelete(RelativeEndpoint relEp){
       if (relEp.id == null){
         throw new ArgumentError.notNull("$relEp");
       }
       return "deleting $relEp";
     }
  }
  
  class RestServer{
  