Remove from php method useAjaxLayout. Now every request from back-end will be returned as json.
Predefined actions has to be done. I have to investigate how to manimulate promise's result to catch predefined methods. Or maybe new promise should be used ...