code: @RequestMapping(value = "/api/scripts", method = RequestMethod.GET)
      public
      @ResponseBody
      HashMap<String, Object> getScripts(Model model,
                                         @RequestParam(required = false) Integer type) throws Exception {
          Script[] scripts = ScriptService.getInstance().getScripts(type);
          return Utils.getJQGridJSON(scripts, "scripts");
      }
docs: Returns all scripts
  
  @param model
  @param type  - optional to specify type of script to return
  @return
  @throws Exception