add lookup/event helpers, fix db