Fix deploy key api 500 if key is empty