slightly better use of python http handling