Add check for USER and PASS in example script
Cleanup and refactor http methods