Adding in callback functions for network calls and making it work with mocha.