Extended API and added tests