title: Retrofit response body gives null
body: <p>I'm trying to use an API that returns JSON, and I'm using Retrofit to get the response and parse it</p>
  
  <p>the API retruns JSON like the following : </p>
  
  <pre><code>{
   "total": 1244881,
   "totalHits": 500,
   "hits": [
    {
     "id": 5205518,
     "pageURL": "https://pixabay.com/photos/landscape-sea-sky-clouds-sunset-5205518/",
     "type": "photo",
     "tags": "landscape, sea, sky",
     "previewURL": "https://cdn.pixabay.com/photo/2020/05/22/14/04/landscape-5205518_150.jpg",
     "webformatWidth": 640,
     "webformatHeight": 427,
      ...
      ...
    },
      ...
      ...
    ]
  }
  
  </code></pre>
  
  <p>And for The GSON to convert this json into an Object I created two classes : 
  the first is : <code>RquestModel.java</code></p>
  
  <pre><code>public class RequestModel {
  
      @SerializedName("total")
      private long total;
  
      @SerializedName("totalHits")
      private long totalHits;
  
      @SerializedName("hits")
      private List&lt;Image&gt; hits;
  
      //Getters and setters down here...
  
  }
  
  </code></pre>
  
  <p>and the second class for the array in the json is : </p>
  
  <pre><code>public class Image {
  
      @SerializedName("id")
      private long id;
  
      @SerializedName("pageURL")
      private String pageURL;
  
      @SerializedName("type")
      private String type;
  
      @SerializedName("tags")
      private String tags;
  
      @SerializedName("previewURL")
      private String previewURL;
  
      @SerializedName("previewWidth")
      private long previewWidth;
  
      @SerializedName("previewHeight")
      private long previewHeight;
  
      @SerializedName("webformatURL")
      private String webformatURL;
  
      @SerializedName("webformatWidth")
      private long webformatWidth;
  
      @SerializedName("webformatHeight")
      private long webformatHeight;
  
      @SerializedName("largeImageURL")
      private String largeImageURL;
  
      @SerializedName("imageWidth")
      private long imageWidth;
  
      @SerializedName("imageHeight")
      private long imageHeight;
  
      @SerializedName("imageSize")
      private long imageSize;
  
      @SerializedName("views")
      private long views;
  
      @SerializedName("downloads")
      private long downloads;
  
      @SerializedName("favorites")
      private long favorites;
  
      @SerializedName("likes")
      private long likes;
  
      @SerializedName("comments")
      private long comments;
  
      @SerializedName("user_id")
      private long userId;
  
      @SerializedName("user")
      private String user;
  
      @SerializedName("userImageURL")
      private String userImageURL;
  
  
      //Getters and Setters down here ..... 
  
  
  
  }
  </code></pre>
  
  <p>And for the interface that the GSON converter uses is like this :</p>
  
  <pre><code>public interface ImageAPIService {
  
      @GET(".")
      public Call&lt;RequestModel&gt; getRequest();
  
  }
  </code></pre>
  
  <p>and When I try to use the response from the Callback like this :</p>
  
  <pre><code>Retrofit retrofit = new Retrofit.Builder()
                              .baseUrl(API_URL)
                              .addConverterFactory(GsonConverterFactory.create())
                              .build();
  
  ImageAPIService api = retrofit.create(ImageAPIService.class);
  
  Call&lt;RequestModel&gt; request = api.getRequest();
  
  request.enqueue(new Callback&lt;RequestModel&gt;() {
      @Override
      public void onResponse(Call&lt;RequestModel&gt; call, Response&lt;RequestModel&gt; response) {
          mViewModel.setTxt(response.body().getTotal() + "");
      }
  
      @Override
      public void onFailure(Call&lt;RequestModel&gt; call, Throwable t) {
  
      }
  });
  </code></pre>
  
  <p>that gives an Exception of type: <code>java.lang.NullPointerException</code> :</p>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'long com.mapps.pixabayclient.models.RequestModel.getTotal()' on a null object reference
  </code></pre>
  
  <p>I tried to debug it and everything seems fine to me, I don't know what I have missed. if someone could notice the mistake, I'd be very thankful. </p>
  
  <p>And thanks for your help in advance.</p>