ajax fixes and some more translation-api code extracted