Use JApplication for setting headers and exiting