updates to add error logging and non-200 responses from the server