Fix HTTP 500 when calling find_societies REST API

Fixes #32