Extract reusable code into wotcs-api-system package