Add error messages and refactor controller

Added capability to render error messages if save/edit is unsuccessful. Also, included `better_errors` and `binding_of_caller` gem for better debugging capability.