Added database populator and fixed some API bugs