cleanup and fixes in app.js
explained in readme how the service works