Add unit test for api.Translate