integrate api with frontend