Moved functions into library controller

Fixed loading gif showing in front of spectrograms on annotation library
page
Changed dev api root back to staging.