checked if posts,comments, and edit is empty, return error, also reduced amount of lines by combining error-success message loops