closures in backend: WIP (not finished!!)