completely rewritten api abstraction layer

- only on the server for now
- not linked to the network services yet