Added basic metrics script and some API improvements