Moved script to .js file, chained route and controller