added functionality for making login request asynchronous, take a look at os.js