separated metadata  into a Util method because not all posts have a value in this JObject; removed EndPoints class; made  getPosts private as it is only needed internally.