Added getPerm function to the API