add http error handling
fix package imports