Fixed minor jshint highlighted issues
Fixed stylistic issues
Changed to use request object instead of just params array