Implemented api unlocking. See issue #5