is there any lapi function to remove group assigned to a folder?
Yes that would be SetObjectRight. Find the node furnish the group to add a bitwise integer of what is the right that you are going to give.
Lapi code does not know how to handle PA enablement from my memeory.Perhaps the code is fixed now.
Here's an example from long time back.I did not know how to check bitwise in code so I cheated and put numbers.
https://communities.opentext.com/communities/cs.dll/wiki/7967685/cs.dll/open/7973190
and the one that says "Want to Add Group/users to Objects"
Want to Revoke User Privileges
You have the same call available in EWS/CWS so consider coding in that