Refactoring and addition of rates API