API and SinglePage

Permalink
Hi all,

I have created a single page where a user can fill in a form to create an order. In the controller of the single page. I make a connection with another system via API calls.

In this controller I have created functions for the different actions:
create contact
create deal
create task
and some more,

I wonder what is the best practice and how to create this control so that it is easier to manage. Like including a config php file for the API settings and creating different files for the actions. Should I do this by extending the class or what is the best way?

Thanks for the help.

Kind regards,

Rik