slightly better handling of http calls