First working and tested version of the API. The data structure is not the agreed one yet though.