Added try-catch-finally.

Put in returnContent to format content to be shown in the browser