ticket:13 add main functionality, migrations