old_contents: var RestClient = require('carbon-client')
  var util = require('util')
  
  if (!(Function.prototype.hasOwnProperty('sync') && 
        Function.prototype.sync.hasOwnProperty('that'))) {
    var fibrous = require('fibrous');
  }
  
  /****************************************************************************************************
   * monkey patch the endpoint class to support sync get/post/put/delete/head/patch
   */
  
  var Endpoint = RestClient.super_
  
  /****************************************************************************************************
   * syncifyClassMethod
   *
   * @param clazz the class
   * @param methodName name of the method to syncify
   */
  
  function syncifyClassMethod(clazz, methodName) {
  
    var asyncMethod = clazz.prototype[methodName]
  
    clazz.prototype[methodName] = function() {
      // if last argument is a callback then run async
      if (arguments && (typeof(arguments[arguments.length-1]) === 'function') ) {
        asyncMethod.apply(this, arguments);
      } else { // sync call!
        return asyncMethod.sync.apply(this, arguments);
      }
    }
  
  }
  /****************************************************************************************************
   * syncify all Endpoint methods
   */
  var ENDPOINT_METHODS = [
    "get",
    "post",
    "head",
    "put",
    "delete",
    "patch"
  ]
  
  ENDPOINT_METHODS.forEach(function(m) { syncifyClassMethod(Endpoint, m) })
  
  /****************************************************************************************************
   * syncify Collection methods
   */
  
  var COLLECTION_METHODS = [
    "insert",
    "update",
    "remove"
  ]
  
  var Collection = Endpoint.collectionClass
  var Cursor = Collection.cursorClass
  
  COLLECTION_METHODS.forEach(function(m) { syncifyClassMethod(Collection, m) })
  
  /****************************************************************************************************
   * syncify Cursor methods
   */
  
  syncifyClassMethod(Cursor, "next")
  syncifyClassMethod(Cursor, "toArray")
  
  
  /****************************************************************************************************
   *
   * @param cb
   * eachSync: sync version of each()
   * TODO: XXX this method is causing program to hang
   */
  Cursor.prototype.eachSync = function(cb) {
    return this.each.sync.apply(this, arguments)
  }
  /****************************************************************************************************
   * exports
   */
  module.exports = RestClient
  
new_contents: var RestClient = require('carbon-client')
  var util = require('util')
  
  // XXX: this is a hack and it should be removed when https://github.com/goodeggs/fibrous/issues/31
  //      gets cleared up
  if (!(Function.prototype.hasOwnProperty('sync') && 
        Function.prototype.sync.hasOwnProperty('that'))) {
    var fibrous = require('fibrous');
  }
  
  /****************************************************************************************************
   * monkey patch the endpoint class to support sync get/post/put/delete/head/patch
   */
  
  var Endpoint = RestClient.super_
  
  /****************************************************************************************************
   * syncifyClassMethod
   *
   * @param clazz the class
   * @param methodName name of the method to syncify
   */
  
  function syncifyClassMethod(clazz, methodName) {
  
    var asyncMethod = clazz.prototype[methodName]
  
    clazz.prototype[methodName] = function() {
      // if last argument is a callback then run async
      if (arguments && (typeof(arguments[arguments.length-1]) === 'function') ) {
        asyncMethod.apply(this, arguments);
      } else { // sync call!
        return asyncMethod.sync.apply(this, arguments);
      }
    }
  
  }
  /****************************************************************************************************
   * syncify all Endpoint methods
   */
  var ENDPOINT_METHODS = [
    "get",
    "post",
    "head",
    "put",
    "delete",
    "patch"
  ]
  
  ENDPOINT_METHODS.forEach(function(m) { syncifyClassMethod(Endpoint, m) })
  
  /****************************************************************************************************
   * syncify Collection methods
   */
  
  var COLLECTION_METHODS = [
    "insert",
    "update",
    "remove"
  ]
  
  var Collection = Endpoint.collectionClass
  var Cursor = Collection.cursorClass
  
  COLLECTION_METHODS.forEach(function(m) { syncifyClassMethod(Collection, m) })
  
  /****************************************************************************************************
   * syncify Cursor methods
   */
  
  syncifyClassMethod(Cursor, "next")
  syncifyClassMethod(Cursor, "toArray")
  
  
  /****************************************************************************************************
   *
   * @param cb
   * eachSync: sync version of each()
   * TODO: XXX this method is causing program to hang
   */
  Cursor.prototype.eachSync = function(cb) {
    return this.each.sync.apply(this, arguments)
  }
  /****************************************************************************************************
   * exports
   */
  module.exports = RestClient
  
subject: add disclaimer