   return editor
 
 loadIntoEditor = (editor, url) ->
-  $.ajax
+  return $.ajax
     url: url
     dataType: "text"
     cache: false

  requestAnimationFrame(handleAnimation)

# Saves all editor contents to LocalStorage
saveCodeToCache = ->
  programId = window.location.hash.slice(1)
  if !programId then throw new Error("No program ID to save")

  # TODO: should check that currentFrame == 0 before saving model
  codeToCache = {}
  for id, editor of editors

  setupLayout()
  setupButtonHandlers()

  $(window).on "onresize", handleResize

  # Create all the JSON and JS editors
  for id in ["modelEditor", "assetsEditor", "actionsEditor", "toolsEditor", "layoutEditor", "servicesEditor"]
    editors[id] = setupEditor(id, "ace/mode/javascript")
