       return
 
     if request.method == 'GET'
-      # FIXME: make only for GET
       response.writeHead 200, {"Content-Type": "text/html; charset=utf-8"}
-      body = generateHtml job.filter, job.page, job.options
+      body = generateHtml job.filter, job.options
       response.end body
     else if request.method == 'POST'
       data = ""

  .replace(/>/g, '&gt;')
  .replace(/"/g, '&quot;')

generateHtml = (filter, page, options) ->

  library = """
  window.jsJobEvent = function(id, payload) {

      jobId = paths[2]
      if paths[3] == 'event'
        return @handleEventRequest jobId, request, response
      else if paths[3] == 'data'
        return @handleDataRequest jobId, request, response
      else
        return response.end()
    else
      return response.end()

  handleDataRequest: (jobId, request, response) ->
    console.log "#{request.method} #{jobId}" if @options.verbose
    job = @jobs[jobId]
    if not job
      # multiple callbacks for same id, or wrong id
      debug 'could not find solve job', jobId
      return

    response.writeHead 200, {"Content-Type": "application/json; charset=utf-8"}
    body = JSON.stringify { input: job.page, options: job.options }
    response.end body

  handleSolveRequest: (jobId, request, response) ->
    console.log "#{request.method} #{jobId}" if @options.verbose
