Add javadoc and some new exceptions