Fixing app using the Node's next() to deal with async calls.