make the initDatabase and registerClient return status code when it fails