added methods for dealing with bytes to API