def presearch(payload, req): #cid = req.getConnectionId() cid = UR.CID uid = UR.getUserId(req); id_search = annotations.save_presearch(cid, payload) output = annotations.presearch(uid, id_search, payload) #{"total": 130, "items": "blahblah"} return UR.prepare_response(output)