Set header and exit with JApplication
Merge pull request #124 from wilsonge/fix/applicationuse

Set headers and exit with JApplication