Calling the backend and saving to the database