Fix travis badge link
check for AttributeError on fetching headers
Added tests
Added env var