Add error codes to register_json and add some password policy