refactored code to make api more generic, added transmitting integers and floats