TODOs re. exception handling. And work on TermApi.valueOf().