client: create answer inside xmlhttprequest function