ajax logic wrapped in server db adapter file