Extracted json API into separate class