fixed bunch of issues about HTTP requests