Patched API and added mining calc