Add ajax setup and global functions to decorate all ajax calls.

It is possible to implement a cache system with these functions.