Adding Tests and Cleaning up wrapper API