Moved API to seperate package and completed javadocs.