Added functionality for inserting posts, some bugfixes