upgrade from depreciated http api