Implement rest and logic for groups page