Note: This is an opinionated question. I m asking this as I was unable to find proper articles covering my concern.

PHP (alone or with a framework like laravel) can be used for both backend and frontend (with templating engines like Blade,Smarty,etc) development.

My concern is:

1. Is it good to use templating engine and create views in PHP?
2. Use PHP just as a backend tech and create APIs, let the frontend be built in any other language (like Angular,React,etc) chosen by the front end developer.
3. If I use templating-engine, is my application getting too tightly coupled between frontend tech choices and backend tech choices?

PS: I hope my concern is clear, if not I will explain it in an elaborated way.
['https://Stackoverflow.com/questions/40522008', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5193722/']
Your response is proper but your parsing is not proper. So first of all add GSON in your gradle file.

`compile 'com.google.code.gson:gson:2.4'`

Now use below your code for parsing your response

```
try {
        JSONArray array = new JSONArray("put your response here");
        Gson gson =  new Gson();
        for (int i = 0 ; i <array.length();i++)
        {
            SurvivorZAMQuestionnaire obj = new SurvivorZAMQuestionnaire();
            obj.add(gson.fromJson(array.getJSONObject(i).toString(),SurvivorZAMQuestionnaire.class));
        }
    } catch (JSONException e) {
        e.printStackTrace();
    }

```

Add your obj in list and show it :)
The Error clearly states that the Gson accepts `JsonObject` not `JsonArray`. In your case you can put the response `JsonArray` into a `JsonObject` with a key for that `JsonArray` and give that key as `annotation` in `SurvivorZAMQuestionList`. By this way you can easily sort this problem.

Hope this is Helpful :)