refactored ajax call

* the success callback and error callbacks are named functions
extracted a View module

* created it to make the app more MVC and sustainable