removed data creation from model init
added json middleware