             compiler_options,
             _path: _path
           )).then((res) => @util.write(compiled_file_path, res.result))
-
-    __parse = (response, resolver) ->
-      try
-        resolver.resolve(JSON.parse(response))
-      catch error
-        resolver.reject(error)

      error_code = require('rest/interceptor/errorCode')
      client = rest.wrap(mime).wrap(error_code)

      client_opts = { path: opts.url }

      if opts.method then client_opts.method = opts.method
      if opts.params then client_opts.params = opts.params
      if opts.headers then client_opts.headers = opts.headers
      if opts.entity then client_opts.entity = opts.entity

      client(client_opts).then (res) -> res.entity

    ###*
     * Reads a file if a path is passed, adds result
     * to records, and returns a resolution.
     * @param {Object} obj - the key's parameters
     * @param {Function} resolve - function to resolve deferred promise
     ###

    file = (obj, resolver) ->
      fs.readFile obj.file, 'utf8', (error, body) ->
        __parse(body, resolver)

    ###*
     * If an object is passed, adds object
     * to records, and returns a resolution.
     * @param {Object} obj - the key's parameters
     * @param {Function} resolve - function to resolve deferred promise
     ###

    data = (obj, resolver) ->
      resolver.resolve(obj.data)

    ###*
     * If a hook was provided in the config, runs the response through the hook.
     *
     * @param {String} key - the record key
     * @param {Object} config - the record's config options
     * @param {Object} response - the record's actual data
     ###

    apply_hook = (obj) ->

      @roots.config.locals.records[obj.key] = obj.data

    ###*
     * This needs to be gutted and refactored still
    ###

    compile_single_views = (collection, template, out_fn) ->
