implemented getPosts and conditional user creation