Create controller.js

Defining its functionalities