Get and post from database