API improvements and pir sensor handling