New functions added to api for serial port, documentation added, api cleaned from unused functions