Created Result model.
Fixed bug with nested for loops in search controller.