Basic API and db methods for badges