Add error handling

And default to production environment which show nice error messages.