Update documentation and minor changes to api