Refactor api_client_test

* Trim and convert to string test made more exact
* Use a helper method to generate error
add new_credit_card_hash method