Added custom hostnames for application and service sites.
Refactored ApplicationController.cs