//get index
require('./../config');
async=require('async');
var bitcoin=require('bitcoin').bitcoin;
var knex=require('knex').knex;

//var bookshelf=require('bookshelf').bookshelf;

exports.index = function(req, res){
  testnet: async.parallel({
    testnet: function(callback){
      bitcoin.getInfo(function(e, info){
        if(e){ return console.log(e);}
        if(info.testnet){
          callback(null, 'bitcoin RPC is testnet');
        }else{
          callback(null, 'nope.. you must be crazy');
        }
      });
    },
    name: function(callback){
      var c=knex('config').select().then(function(r){
        callback(null, r[0].site_name);
      });
    }
  },
  function(err, r){
      res.render('index', { title: r.name, testnet: r.testnet });
  });
  
};
@@ -33,32 +33,44 @@
 ');%0A
-async=require('async'
+var Promise = require(%22bluebird%22
 );%0A
+%0A
 var 
@@ -136,16 +136,74 @@
 ).knex;%0A
+Promise.promisifyAll(require('bitcoin').Client.prototype);
 %0A//var b
@@ -286,88 +286,119 @@
 %7B%0A  
-testnet: async.parallel(%7B%0A    testnet: function(callback)%7B%0A      bitcoin.getInfo
+var info = bitcoin.getInfoAsync();%0A  var config = knex('config').select();%0A  Promise.all(%5Binfo, config%5D).spread
 (fun
@@ -407,174 +407,150 @@
 ion(
-e, 
 info
-)%7B%0A        if(e)%7B return console.log(e);%7D%0A        if(info.testnet)%7B%0A          callback(null, 'bitcoin RPC is testnet');%0A        %7Delse%7B%0A          callback(null,
+, config) %7B%0A      res.render('index', %7B%0A          title: config%5B0%5D.site_name,%0A          testnet: info.testnet ? 'bitcoin RPC is testnet' :
  'no
@@ -576,20 +576,8 @@
 azy'
-);%0A        %7D
 %0A   
@@ -592,80 +592,15 @@
    %7D
-,%0A    name: function(callback)%7B%0A      var c=knex('config').select().then
+).catch
 (fun
@@ -605,17 +605,17 @@
 unction(
-r
+e
 )%7B%0A     
@@ -619,156 +619,31 @@
     
- 
- callback(null, r%5B0%5D.site_name);%0A      %7D);%0A    %7D%0A  %7D,%0A  function(err, r)%7B%0A      res.render('index', %7B title: r.name, testnet: r.testnet %7D);%0A  %7D);%0A  %0A%7D;
+console.log(e);%0A    %7D);%0A%7D;%0A

Change to using promisify instead of async for better code and easy error handling