add login api and create javadoc