Adding error catching to deal with null data coming from the API