solution for parse json issues in rails