Model migration

last merge request of the night. ajax was not successfully implemented