add library functions for return badge_id and data array
add tests around lib functions