add basic http errors handling