Changes to the API. Code cleaning still not done