create mongoose model
split some logic into separate files

add controller