moved ajax functions to application.js

also fixed error where bootstrap css files were not found by browser
resulting in errors in console