saving api with params to database