Making network graph dynamic using ajax