fixed some bugs and added first sensor api