added language API and fixes
bugfixes