Add proper response handling to DAOs

Add a check to the http status code returned from the API and report
and error if it is greater or equal to 400.