API modified, test and example cleaned