Update controller.js

Adjust controller code for new entries and format