avoid passing the whole app-state to apis

(get-in map nil) => map !!!