Added edit and update actions for units, modified controllers with conditionals and formats for html and json