Copied over the remaining controller/actions and views code