api and getting it to the database