Change logic to all ajax for adapter.js