Add error check when status code is not 200