fixed up db schema and started work onAPI implementation