Converting JSON to entities