restructured as a class
fixed API communication
added a function to find a wavelength