Merge pull request #43 from dimagi/cz

fix various 500's
also catch key errors in lookup