Added try/catch for using/creating FormData, for it's not available on client-side.