Server side code of ESN. CakePHP