Move web constants to client. Updated controller to handle errors
cleaner. Fixed error in device marshaling.