added REST api

Fixed 'portable module pattern' of Net.js…