Added translate API with tests. fixed #2