API server now closes when application ends