             else
                 res.send {"ok":"1","crashdata": crashdata}
 
+    app.get "/crashsimilarity/:id", (req, res) ->
+        id = req.params.id
+        get_crash_similarity_by_id id, (err,data) ->
+            if err?
+                res.send {"ok":"0","errors": err} if err?
+            else
+                res.send {"ok":"1","data": data}
+
+
 
 exports.init_query_api        = init_query_api
 exports.get_crashreport_by_id = get_crashreport_by_id

# module globals
DB_CRASHREPORTS  = "" #crashreport collection in db, set by init function
SETTINGS         = {} #global settings

get_crashreport_by_id = (id, cb) ->
        DB_CRASHREPORTS.find({"id":id}).run (err,arr) ->

                cb null, arr[0]
            else
                cb "ERROR: Multiple crashlogs found with id:#{id}", null

get_crash_similarity_by_id = (id, cb) ->
    DB_CRASHREPORTS.find({"id":id}).one().run (err,crashreport) ->
        return cb err,null if err?
        return cb "ERROR: Crashreport not found with id:#{id}", null if not crashreport?

        return cb null, crash_similarity_value(crashreport)

init_query_api = (settings, app, db) ->
    DB_CRASHREPORTS = db.collection('crashreports')
