Implementation of the API