Moved index functionality to controllers. Added user functionality