Add callback support for parse function