Refactoring + rest resources

added radio select buttons for items and REST resources plus lots of
refactoring.