Added functions check_initial_registration and check_initial_call to see...

I'm confused why you create the AccountDb here? Do you mean to explicitly pattern match line 35 below against this variable? This basically works as an assertion, crashing the request if the AccountDb doesn't match whatever is stored in the `pvt_account_db` key in `JObj`.

Also, use `couch_mgr:open_cache_doc/2` instead, as these documents are often accessed and can be cached on the local VM to avoid the round trip to the DBs.