Added type to API element (line 116) and replaced unprotected attributes (line 156) with Permissions element