var nets = require('nets');
var KeggClient = {};

KeggClient.listPathway = function(org, callback) {
	var options = {
		url: 'http://rest.kegg.jp/list/pathway/' + org
	};
	nets(options, function(error, response, body) {
		if (!error && response.statusCode === 200) {
			callback(body);
		} else {
			throw error;
		}
	});
};

KeggClient.conv = function(target_db, source_db, callback) {
	var options = {
		url: 'http://rest.kegg.jp/conv/' + target_db + '/' + source_db
	};
	nets(options, function(error, response, body) {
		if (!error && response.statusCode === 200) {
			callback(body.toString())
		} else {
			throw error;
		}
	});
};

// KeggClient.get = function(dbentries, callback) {
	
// }

module.exports = KeggClient;
// KeggClient.listPathway("eco");
// KeggClient.conv("eco", "ncbi-geneid");
@@ -315,24 +315,289 @@
 %09%7D%0A%09%7D);%0A%7D;%0A%0A
+KeggClient.listGene = function(org, callback) %7B%0A%09var options = %7B%0A%09%09url: 'http://rest.kegg.jp/list/' + org%0A%09%7D;%0A%09nets(options, function(error, response, body) %7B%0A%09%09if (!error && response.statusCode === 200) %7B%0A%09%09%09callback(body);%0A%09%09%7D else %7B%0A%09%09%09throw error;%0A%09%09%7D%0A%09%7D);%0A%7D;%0A%0A
 KeggClient.c
@@ -637,32 +637,32 @@
 db, callback) %7B%0A
-
 %09var options = %7B
@@ -952,10 +952,9 @@
 ) %7B%0A
-%09
 %0A
+
 // %7D
@@ -1018,16 +1018,16 @@
 %22eco%22);%0A
-
 // KeggC
@@ -1059,8 +1059,9 @@
 eneid%22);
+%0A

add listGene