Updated for API
Also started work on a more complete database class
Signed-off-by: Justin Wiblin <jwiblin95@gmail.com>