implemented model code and typo in test
updated db types for correct handling of arrays