Update controllers.js

Added http functionality