fixed a bug where exceptions would occur when invalid data from api