db refactor and some error handling added in api.go
Merge branch 'master' of https://github.com/aimless/g0