Added functionality for adding, updating and deleting posts