updated loadurl task, refactored mongo connection