Question: I imported amazon echo dot 2nd generation from US to India.
As amazon echo dot now supports in india while setting up wifi , I am getting error as "Unable to configure device language". 
I tried with all languages available i.e. En-in , en-us , en-uk, Deutsch but i am getting same error.

Can anyone please help me here?

Answer: 
You need to return an Observable from your post request. This is **asynchronous**, so your response is available in your **callback**. Even if you would try and do that from your callback `subscribe`, this is not possible, since again, this is asynchronous. So what you need to return from your post request is an Observable:

```
return this.http.get(this.apiPostUrl, {params: params})
  .map((res: Response) => res.json())

```

Here you could actually skip the `authenticate` method from between, I don't see how it's useful for you here. But if you want to keep it, of course you can :)

So what you would then do, is to subscribe to this post request in your component.

```
constructor(private restApiService: RestApiService /** **/) { }

onSubmit() {
  const formModel = this.loginForm.value;
  this.restApiService.postCredentials(formModel.email, formModel.password);
    .subscribe(.....)
}

```

worth reading: [How do I return the response from an Observable/http/async call in angular2?](https://stackoverflow.com/questions/43055706/how-do-i-return-the-response-from-an-observable-http-async-call-in-angular2)
Use `interface` instead of class and typecast your response as below,

```
getData(){
    return this.http.get(this.apiUrl).map((res: Response) => <Account> res.json())
  }

```

**Note** : If you are using class you should have a constructor to set the properties.