move http handling to utils module