http to handle empty result and error status correctly.