cleaned up js code
made use of Authorize attribute in the hub