handle invalid api request