Goals backend - main functionality done