http errors handling controller and import optimisation