Added ajax loader gif, refactor load_plan method