Rest api fixes

Ticket #17 related.

Fixing issues with User/Group resources that caused to throw an error while accessing the API. Also added regression tests for that.