initial commit: extracted from old opentrophy-api ;)