Add basic unittest for api user
Add unittest for permission parsing