WIP: first version of app.js
just adding security
now everything seems to be working
fixing little erros in the architecture of the applciation.
first working version. But needs to fix the timing issue