Updated API handler, closes #6