Fixed a duplicate ajax calls and cleaned up JS a bit more
Fixed a duplicate ajax calls and cleaned up JS a bit more

MjAbuz/Kibana,MjAbuz/Kibana,melexis/kibana,rashidkpc/kibana2,CSGOpenSource/Kibana2,CSGOpenSource/Kibana2,melexis/kibana,MjAbuz/Kibana,MjAbuz/Kibana,alphagov/Kibana,CSGOpenSource/Kibana2,rashidkpc/kibana2,alphagov/Kibana,melexis/kibana,rashidkpc/kibana2,alphagov/Kibana,rashidkpc/kibana2