Use core-ajax functions.
Updated tests.