Fixed async bug in adding to the database and sending a response