For help in gettting an API working you might find the link below useful. It’s my own small app for monitoring a HPC at my Uni. I use the PBS include file to create a Python API that is more understandable and simple to use. It then called as a Python library.