API is important to get data from server without having to store everything locally.
There are lots of ways to create API but most common one is creating REST API.
Graphql is another way to create API which mainly helps in solving a lot of problems the REST API has. You can use any programming language to create API. You can create it in Java, Python, Node or Express.
Node and express are basically used for server side functionality. Like reading and writing to files and command line options etc .There are many languages that you can use to create them.
If you are struggling to learn API, see acedmind YouTube channel in that they have a playlist called creating a restful API. There they explain a lot of basics about what a API is and everything.