Make API more flexible

Still a lot to do!