created basic api calls to getAllPosts