Optimal Transportation And Barycenter Problems Via Convex Functions