methods added for parsing api response.