Added json parsing to controller
Moved things into more standard package structure