code cleanup and added device edit page and jsoneditor