adding api.js
adding express.bodyParser for json parsing