     startJson = jsonPart.indexOf '{'
     endJson = jsonPart.lastIndexOf '}'
     json = jsonPart.substring startJson, endJson+1
-    console.log json
     return [null, JSON.parse(json)]
 
 

uCaseHeader = (headerName) ->
    return headerName.replace /\w*/g, uCaseWord

couchDBHeaders = (nodeHeaders) ->
    couchHeaders = {}
    for  name in Object.keys(nodeHeaders)
        couchHeaders[uCaseHeader(name)] = nodeHeaders[name]
    return couchHeaders

retrieveJsonDocument = (data) ->
    # Retrieve separator

    data = []
    permissions = false
    req.on 'data', (chunk) =>
        if permissions
            stream.emit 'data', chunk
        else
