Extracted HTTP connection to a function.
Fixed project id option not working.