var freenode = {
  name: 'freenode',
  host: 'chat.freenode.net',
  port: 6667,
  nickname: 'fernando',
  channels: [
    '#nova.angular'
  ]
};

var novaangular = {
  name: '#nova.angular',
  server: 'freenode',
  users: [
    {
      nick: 'rossk',
      ip: '192.168.1.1',
    },
    {
      nick: 'greggt',
      ip: '192.168.1.2'
    }
  ]
};

module.exports = function(app) {
  app.get('/api/servers', getServers);
  
  app.get('/api/servers/:server/:channel', getChannel);
  app.get('/api/servers/:server', getServer);
};

var getServers = function getServers(req, res, next) {
  var servers = [
    freenode
  ];
  res.json(servers);
};

var getServer = function getServer(req, res, next) {
  if (req.params.server === 'freenode') {
    res.json(freenode);
  }
  else {
    res.send(404);
  }
};

var getChannel = function getChannel(req, res, next) {
  var server = req.params.server;
  var channel = req.params.channel;
  if (server !== 'freenode' || channel !== '#nova.angular') {
    res.send(404);
  }
  else {
    res.json(novaangular);
  }

};
@@ -1,150 +1,4 @@
-var freenode = %7B%0A  name: 'freenode',%0A  host: 'chat.freenode.net',%0A  port: 6667,%0A  nickname: 'fernando',%0A  channels: %5B%0A    '#nova.angular'%0A  %5D%0A%7D;%0A%0A
 var 
@@ -196,16 +196,158 @@
   %5D%0A%7D;%0A%0A
+var freenode = %7B%0A  name: 'freenode',%0A  host: 'chat.freenode.net',%0A  port: 6667,%0A  nickname: 'fernando',%0A  channels: %5B%0A    novaangular%0A  %5D%0A%7D;%0A%0A
 module.e
@@ -445,16 +445,82 @@
 :server/
+channels', getChannels);%0A  app.get('/api/servers/:server/channels/
 :channel
@@ -856,24 +856,219 @@
 4);%0A  %7D%0A%7D;%0A%0A
+var getChannels = function getChannels(req, res, next) %7B%0A  var server = req.params.server;%0A  if (server === 'freenode') %7B%0A    res.json(freenode.channels);%0A  %7D%0A  else %7B%0A    res.send(404);%0A  %7D%0A%7D;%0A%0A
 var getChann

add channels api