Rejection handling and usage example

Added rejection handling and an usage example.