take nodes and lines via json from server side