Added some more auth stuff and set up device edit and view.