fixed logic in create_user command
debug_print function flushes stdout immediately
return user from check_auth; store api_key