Added CURL flag to follow redirects as well as mongoDB insert