Handle errors in setting resource files.

Closes #378.
For future, we should probably replace Option[JsValue] with Either or
Try in order to propagate better error information back to the
controllers.