fixed bug where json request happened twice; refactoring out jquery