I asked this question some days ago but I did not include relevant code so I try again, thanks to everyone who tried to help with their best effort!
I have a API in P