Wrap async function to standard express function
@param {Function} fn the async function
@returns {Function} the wrapped function
function wrapRoute(fn) {
  if (!_lodash2.default.isFunction(fn)) {
    throw new Error('fn should be a function');
  }
  return function (req, res, next) {
    try {
      var result = fn(req, res, next);
      if (result && result.catch) {
        result.catch(next);
      }
    } catch (e) {
      next(e);
    }
  };
}