implemented pushnotifications function into index.js

various changes on js files