code refactoring & error handling
database model update: add auto increament id