With an API I could handle all transactions. It will make the code more clear.