add auth_check api
add error code
Merge pull request #4 from michaelfung/master

add auth_check api