Added the validation of response.data, it maybe a null