Many improvments to API