Use the new subnet data model in REST API
This is a followup work to #165 (closed). There are two major changes required:
- When an app is added to the database we need to parse its configuration and detect the subnets it belongs to. Those subnets have to be stored in the database.
- The REST API has to be modified to return the new subnet and shared network instances.