server side code for lucy