Added functionality into posts for creating and updating.