Revise database calls to return promises and genericize inserts