send correct data in correct format to rails for parsing