check http status before decode json. This fixes #11