Feature/api

Implements basic API.