Added q to applicationController - now returns promises for some functions.