Refactored the rake task, client api added