fix oauth_nonce generation and remove inefficient function
fix rest api