Views + controllers

removed legacy, added new files, R code and json fixes.