http wrapper error fix, code cleanup