put json parser in seperatefunction