old_contents: module.exports = function sendFile(name, absolute){
      var fs = require('fs')
         ,api  = require('../api.js')
      return function sendFile(req, res){
      var fstream = fs.createReadStream((absolute ? '' : __dirname + '/../../') + name)
          fstream.on('open', function(fd){
              try{
                  res.writeHead(200,{
  'Content-Type': ~name.indexOf('css') ? 'text/css' : 'application/javascript',
  'Content-Length': fs.fstatSync(fd).size
                  })
                  fstream.pipe(res)
              } catch(ex){
                  res.json('')
                  api._err(api.ipt(ex))
              }
          })
          fstream.on('error', function(err){
              api._err(api.ipt(err))
              res.statusCode = 404
              res.end()
          })
      }
  }
  
new_contents: module.exports = function sendFile(name, absolute){
  var fs = require('fs')
     ,api  = require('../api.js')
      return function sendFile(req, res){
      var fstream = fs.createReadStream((absolute ? '' : __dirname + '/../../') + name)
          fstream.on('open',
              function on_fstream_open(fd){
                  fs.fstat(fd,
                      function on_fstat(err, stat){
                          if(err){
                              res.statusCode = 500
                              err = api.ipt(err)
                              api._err(err)
                              res.txt(err)
                              return
                          }
                          res.setHeader('Content-Length', stat.size)
                          res.setHeader('Content-Type',(
                             ~name.indexOf('css') ? res.ContentTypes.TextCSS :
                             ~name.indexOf('.js') ? res.ContentTypes.AppJS :
                              res.ContentTypes.TextPlain)['Content-Type']
                          )
                          fstream.pipe(res)
                      }
                  )
              }
          )
          fstream.on('error',
              function on_fstream_error(err){
                  res.statusCode = 500
                  err = api.ipt(err)
                  api._err(err)
                  res.txt(err)
              }
          )
      }
  }
  
subject: rework for async and consisyent header setting