Checked status code for errors first