Cleaning up code for MySql adapter and updating check for dups with new API response. #638