strip whitespace
fix threading issue and change cors to use ip address