Adds withdraw api, refactoring of api call chain